Skip to content

Introduce RUSTUP_DOWNLOAD_TIMEOUT to override the download timeout #4440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FranciscoTGouveia
Copy link
Contributor

Fixes #4439.

Besides increasing the default timeout from 30 seconds to 3 minutes, a new environment variable (RUSTUP_DOWNLOAD_TIMEOUT) is introduced to allow users to override this value.

Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see that you are now passing Duration by value!

This change is needed to allow us to pass an argument for the creation
of the client, as it is being done in `rustls_client()`.
…ng download timeout

As some (corporate) firewalls take too much time to verify the
downloads, the timeout is reached and the user cannot complete its
installation.

Besides changing the timeout from 30 secs to 3 mins, a new environment
variable is introduced to allow users to override the timeout value to
their taste.
@FranciscoTGouveia FranciscoTGouveia marked this pull request as ready for review August 13, 2025 15:01
@@ -620,12 +635,13 @@ mod reqwest_be {
static CLIENT_RUSTLS_TLS: OnceLock<Client> = OnceLock::new();

#[cfg(feature = "reqwest-native-tls")]
pub(super) fn native_tls_client() -> Result<&'static Client, DownloadError> {
pub(super) fn native_tls_client(timeout: Duration) -> Result<&'static Client, DownloadError> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth commenting that the timeout being passed in does nothing when CLIENT_NATIVE_TLS is already initialized (idem for CLIENT_RUSTLS_TLS)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download TimedOut on company firewall
3 participants